<?php

try {
	$host = "localhost";
	$dbname = "tyrant";
	$user = "root";
	$pass = "";

	$db = new PDO("mysql:host=$host; dbname=$dbname", $user, $pass);

} catch(PDOException $e) {
	echo $e->getMessage();
}

/*$host = "localhost";
$db = "tyrant";
$user = "root";
$pass = "root";

//connect to server with these credentials
mysql_connect($host, $user, $pass) or DIE("Unable to create a connection with mysql server");

//select the db
mysql_select_db($db) or DIE("tyrant isnt available... create it");
*/

/*
class tyrant {
	protected $host;
	protected $db;
	protected $user;
	protected $pass;
	
	public function __construct() {
		$this->host = "localhost";
		$this->db = "tyrant";
		$this->user = "root";
		$this->pass = "root";
		
		//connect to server with these credentials
		mysql_connect($this->host, $this->user, $this->pass) or DIE("Unable to create a connection with server");

		//select the db
		mysql_select_db($this->db) or DIE("tyrant isnt available... create it");
	}
}*/


/*
$db = mysql_connect("localhost", "root", "root");
$sqltable = "nexus";
mysql_select_db($db, $sqltable);
	
if(!$db) {
	die("Couldn't connect to the database man... Heres the details: " . mysql_error());
}*/

/*
$sql = mysql_query($query);

//for mini_cal 
$sql = mysql_query("SELECT users.fname, users.lname, cal.model_name, cal.date, cal.assignment FROM cal INNER JOIN users ON cal.id_users = users.id;");

$minicalresult = mysql_fetch_object($sql);
*/